<div class="page-toolbar">
    <div class="page-filter fl">
        <form class="layui-form layui-form-pane" action="{:url()}" method="get" id="hisi-table-search">
        <div class="layui-form-item">
        	<label class="layui-form-label">搜索</label>
            <div class="layui-input-inline">
                <input type="text" name="keyword" lay-verify="required" placeholder="输入关键字，按回车搜索" class="layui-input">
            </div>
        </div>
        </form>
    </div>
</div>

<table id="dataTable"></table>

{include file="system@block/layui" /}

<script type="text/html" title="操作按钮模板" id="buttonTpl">
    <a href="{:url('edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal hisi-iframe" hisi-data="{width: '470px', height: '400px'}" title="关联管理员">关联管理员</a>
</script>

<script type="text/html" id="toolbar">
    <div class="layui-btn-group fl">
		<a href="{:url('sync')}" refresh="true" class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-refresh green hisi-ajax">&nbsp;从企业微信同步用户</a>
    </div>
</script>

<script type="text/javascript">
    layui.use(['table'], function() {
    	var $ = layui.jquery;
        var table = layui.table;
        var status = $.parseJSON('{:json_encode($status)}');
        table.render({
            elem: '#dataTable'
            ,url: '{:url()}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,text: {
                none : '暂无相关数据'
            }
            ,toolbar: '#toolbar'
            ,defaultToolbar: ['filter', 'exports', 'print']
            ,cols: [[ //表头
                {field: 'userid', title: '成员UserId'}
                ,{field: 'name', title: '成员名称'}
                ,{field: 'admin_id', title: '关联管理员ID'}
                ,{field: 'mobile', title: '手机号码'}
                ,{field: 'email', title: '邮箱'}
                ,{field: 'status', title: '状态', templet: function(d){return status[d.status]}}
                ,{field: 'create_time', title: '创建时间', templet:function(d){return layui.util.toDateString(d.create_time * 1000)}}
                ,{field: 'update_time', title: '更新时间', templet:function(d){return layui.util.toDateString(d.update_time * 1000)}}
                ,{title: '操作', templet: '#buttonTpl', fixed: 'right'}
            ]]
        });
    });
</script>